package com.adam.masterSpringMVC4.profile;

import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

public class ProfileForm {

    @NotNull
    private UserProfileSession.LoginType loginType;
    @Size(min = 2, max = 12)
    private String userName;
    @Email
    @NotBlank
    private String email;
    @NotNull
    private LocalDate birthDate;
    @NotEmpty
    private List<String> tastes = new ArrayList<>();

    public UserProfileSession.LoginType getLoginType() {
        return loginType;
    }

    public void setLoginType(UserProfileSession.LoginType loginType) {
        this.loginType = loginType;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public LocalDate getBirthDate() {
        return birthDate;
    }

    public void setBirthDate(LocalDate birthDate) {
        this.birthDate = birthDate;
    }

    public List<String> getTastes() {
        return tastes;
    }

    public void setTastes(List<String> tastes) {
        this.tastes = tastes;
    }

    @Override
    public String toString() {
        return "ProfileForm{" +
                "userName='" + userName + '\'' +
                ", email='" + email + '\'' +
                ", birthDate=" + birthDate +
                ", tastes=" + tastes +
                '}';
    }
}
